import argparse

import pyperclip

from llm import call_llm
from llm import gen_youhua_prompt


def main():
    parser = argparse.ArgumentParser(description="文案优化工具")
    parser.add_argument("output", help="输出目录")
    args = parser.parse_args()
    text = pyperclip.paste()
    with open(args.output, "w") as f:
        pass
    system_prompt, user_prompt = gen_youhua_prompt(text)
    content = call_llm(system_prompt, user_prompt)
    with open(args.output, "w") as f:
        f.write(content)
    print(f"save to: {args.output}")


if __name__ == "__main__":
    main()
